import React, {Component} from 'react';
import {
    StyleSheet,
    View,
    Modal,
    ActivityIndicator,
}from 'react-native';

export default class Loading extends Component {
    constructor() {
        super();
    }

    render() {
        return (
            <Modal
                visible={this.props.visibility}
                transparent={true}
                animationType={'fade'}
                onRequestClose={()=>this.setState({visibility:false})}
            >
                <View style={styles.container}>
                    <View style={styles.modalContainer}>
                        <ActivityIndicator color='white' size="large"/>
                    </View>
                </View>
            </Modal>
        )
    }
}

const styles = StyleSheet.create({
    container:{
        flex:1,
        backgroundColor:'transparent',
        justifyContent:'center',
        alignItems: 'center',
    },
    modalContainer: {
        width:80,
        height:80,
        borderRadius: 4,
        backgroundColor: "black",
        alignItems:'center',
        justifyContent: 'center'
    },

})